package stream.map;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

//英文字符串的元素全部改为大写 整数数组每个元素+3
public class demo {
    public static void main(String[] args) {
        //map(String::toUpperCase)  String::此处接String的方法
        String[] strArr = { "abcd", "bcdd", "defde", "fTr" };
        List<String> stringList = Arrays.stream(strArr).map(String::toUpperCase).collect(Collectors.toList());

        List<Integer> intlist = Arrays.asList(1, 3, 5, 7, 9, 11);
        List<Integer> intlistNew = intlist.stream().map(x -> x + 3).collect(Collectors.toList());

        System.out.println("每个元素大写："+stringList);
        System.out.println("每个元素+3:" +intlistNew);
    }
}
